/**
 * Created by scenic on 2017/7/15.
 */


describe("TestSpace", function () {
    var gsbuild = GSResource;
    var gsthree = GSThree;
    it("createRootBoxSpace", function () {


        var start = new gsthree.StartNB()
        var scene = start.newScene("main")
        new gsthree.LightConfig(scene).addAmbientLight().addDirectionLight();
        start.autoRender();

        var space = new gsbuild.SpaceUtils.createRootBoxSpace(1400,900,500);
        space.addMeshToScene(scene);



        var mesh = space.getAssociateMesh();
        var size = mesh.getDimension();

        expect({x:size.x,y:size.y,z:size.z}).toEqual( {x:1400,y:900,z:500 });
    })



    it("updateResource", function () {
        var space = new GSResource.BoxSpace(1400,900,500);
        space.setSegment("1:1:1",new THREE.Vector3(1,0,0));
        space.updateSegment();

        GSResource.SpaceUtils.updateResource(space);
        GSResource.SpaceUtils.updateResource(space);
        GSResource.SpaceUtils.updateResource(space);
        GSResource.SpaceUtils.updateResource(space);
        GSResource.SpaceUtils.updateResource(space);



        expect(1).toBe(1);
    })

})